document.write('<script src="js/jquery.rotate.min.js"></script>');
$(function(){
	LoadingStr(0);
	setLoading();
	rotation();
});


function rotation()
{
	$("#loadbg").rotate({
	      angle:0, 
	      animateTo:360, 
	      callback: rotation,
	      easing: function (x,t,b,c,d){        // t: current time, b: begInnIng value, c: change In value, d: duration
	          return c*(t/d)+b;
	      }
	   });
}

function LoadData(time)
{
	var isload = false;
	var w = parseInt($(window).width());
	var h = parseInt($(window).height());
	var hh =  parseInt($(document).height());

	$("#loadBox").css("display","block");

	if(parseInt(time)>0)
	{
		setTimeout(function(){
				$("#loadBox").css("display","none");
		},time); 
		
	}

	if(parseInt(time)<0)
	{
		$("#loadBox").css("display","none");
	}
	isload = true;
	return isload;
}

function setLoading()
{

	var w = parseInt($(window).width());
	var h = parseInt($(window).height());
	var hh =  parseInt($(document).height());
	
	
	var loadBoxW = parseInt($("#loadBox").width());
	
	var rw = (w-loadBoxW)/2;	
	var rh = (h-loadBoxW)/2;
	var nobgpng = parseInt($("#loadBox").width());
		
		
	$("#nobgpng").css("width",nobgpng+"px");
	$("#nobgpng").css("height",nobgpng+"px");
		
	$("#loadBox").css("height",nobgpng+4+"px");
		
		
	$("#loadBox").css("width",nobgpng+"px");
		
		
	$("#loadBox").css("left",parseInt(rw)+"px");
	$("#loadBox").css("top",rh+"px");
		
		
		
		
	$("#loadingimg").css("width",nobgpng/2*1.2+"px");
		
		
	var loadingimgW = $("#loadingimg").width();
		
	$("#loadingimg").css("left",(nobgpng-loadingimgW)/2-1+"px");
	$("#loadingimg").css("top",(nobgpng-loadingimgW)/2+3+"px");
	
}
function LoadingStr(isshow)
{
	
	if(isshow==1)
	{
		var str = '<div id="loadBox" style="display:block"><div id="loadbg"><img src="images/nobg.png" id="nobgpng"></div><div><img src="images/loadingimg.png" id="loadingimg"></div></div>';
	}
	else
	{
		var str = '<div id="loadBox" style="display:none"><div id="loadbg"><img src="images/nobg.png" id="nobgpng"></div><div><img src="images/loadingimg.png" id="loadingimg"></div></div>';
		
	}
	$("body").after(str);
}
function zv_load(time){
   		setTimeout(function(){
				$("#loadBox").css("display","none");
		},time);
}